<?php session_start();
require_once "functions.php";
if (isset($_SESSION['lang']))
    require_once "./language_files/add_rebuttal_" . $_SESSION['lang'] . ".php";
else
    require_once "./language_files/add_rebuttal_en.php";
$member = $_SESSION['member_id'];
if (isset($_POST['commentID']) && isset($_POST['paperID']) && isset($_POST['text']) && $_POST['text'] != NULL) {
    $paper = $_POST['paperID'];
    $comment = $_POST['commentID'];
    $text = mysql_safe($_POST['text']);
    $add = mysql_query("INSERT INTO a_rebuttal_paper (comment_id, paper_id, member_id, rebuttal_text)
        VALUES ($comment, $paper, $member, '$text')") or die($lang['message_1']);
    echo "1";
} else {
    echo "0";
}
?>
